import * as Rx from "rxjs";
import store from "../../../rx/store";

class CategoryStore {

  constructor(key) {
    this.updates = new Rx.BehaviorSubject(store(key));
    this.todos = this.updates
      .scan(function (todos, operation) {
          return operation(todos);
      });
    this.key = key;
    this.todos.forEach(function(todos) {
      store(key, todos);
    });
  }
}

export default CategoryStore;
